package com.jiazhong.ssm.test01整合.controller;

import com.jiazhong.ssm.test01整合.pojo.User;
import com.jiazhong.ssm.test01整合.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Auther:shuXin
 */
@RestController
@RequestMapping("user")
public class UserController {
    @Autowired
    private UserService userService;

    @GetMapping("query")
    public List<User> getAllUser() {
        //调用Service的方法
        List<User> allUser = userService.getAllUser();
        return allUser;
    }
}
